import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    // 用户的验证信息,默认从缓存获得
    token: localStorage.getItem('token'),
    refresh_token: localStorage.getItem('refresh_token')
  },
  mutations: {
    // 更改token
    setToken (state, value) {
      state.token = value
    },
    setRefresh_token (state, value) {
      state.refresh_token = value
    }
  },
  actions: {
  },
  modules: {
  }
})
